<html>
<head><meta charset="utf-8"><title>Issue with `rustc_middle::mir_built()` · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html">Issue with `rustc_middle::mir_built()`</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="218157739"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218157739" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218157739">(Nov 28 2020 at 10:14)</a>:</h4>
<p>EDIT: This issue was due to an incremental cache error, it was replaced by another one (that I'm trying to understand) after a <code>cargo clean</code></p>
<p><del>To keep it short, I took librustdoc as a base, forked it and then heavily modified it. When calling <code>mir_built()</code> I get a panic if I analyze more than one file. I'm calling my custom analysis from <code>core.rs:run_global_ctxt()</code>. I can reproduce the bug by replacing my whole analysis by this function:</del></p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">my_custom_analysis</span><span class="p">(</span><span class="n">tcx</span>: <span class="nc">ty</span>::<span class="n">TyCtxt</span><span class="o">&lt;'</span><span class="nb">_</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">HashMap</span><span class="o">&lt;</span><span class="n">DefId</span><span class="p">,</span><span class="w"> </span><span class="n">FunctionDependencies</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">// let mut monomorphized_functions: HashSet&lt;(DefId, String)&gt; = default();</span>
<span class="w">    </span><span class="n">tcx</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">body_owners</span><span class="p">()</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">filter_map</span><span class="p">(</span><span class="o">|</span><span class="n">caller</span><span class="o">|</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="kd">let</span><span class="w"> </span><span class="n">mir</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tcx</span><span class="p">.</span><span class="n">mir_built</span><span class="p">(</span><span class="n">ty</span>::<span class="n">WithOptConstParam</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="n">did</span>: <span class="nc">caller</span><span class="p">,</span><span class="w"></span>
<span class="w">                </span><span class="n">const_param_did</span>: <span class="nc">tcx</span><span class="p">.</span><span class="n">opt_const_param_of</span><span class="p">(</span><span class="n">caller</span><span class="p">)</span><span class="w"></span>
<span class="w">            </span><span class="p">});</span><span class="w"></span>
<span class="w">            </span><span class="nb">None</span><span class="w"> </span><span class="c1">// mir real code does stuff with mir ;)</span>
<span class="w">        </span><span class="p">})</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">collect</span><span class="p">()</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p><del>When I run my rustdoc fork on a single file it works perfectly:</del></p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>cargo run -- some_file.rs
</code></pre></div>
<p><del>However if I try to run it on a whole project, I get a panic:</del></p>
<div class="codehilite"><pre><span></span><code>$ RUSTDOC=target/release/my_binary cargo doc
thread &#39;rustc&#39; panicked at &#39;attempted to read from stolen value&#39;, /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_data_structures/src/steal.rs:35:21
</code></pre></div>
<p><del>I think I don't understand how I'm supposed to use MIR. I thought, that I long as I only called <code>mir.borrow()</code> to be able to use <code>mir::Body</code> I was fine (and not <code>mir.steal()</code>). What am I missing?</del></p>



<a name="218167962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218167962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218167962">(Nov 28 2020 at 15:06)</a>:</h4>
<p>NOTE: I previously posted this exact same topic, and removed it because I thought that it was due to a bug in the incremental build cache. It wasn't <span aria-label="sad" class="emoji emoji-2639" role="img" title="sad">:sad:</span> </p>
<p>To keep it short, I took librustdoc as a base, forked it and then heavily modified it. When calling <code>mir_built()</code> I get a panic if I analyze more than one file. I'm calling my custom analysis from <code>core.rs:run_global_ctxt()</code>. I can reproduce the bug by replacing my whole analysis by this function:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">my_custom_analysis</span><span class="p">(</span><span class="n">tcx</span>: <span class="nc">ty</span>::<span class="n">TyCtxt</span><span class="o">&lt;'</span><span class="nb">_</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">HashMap</span><span class="o">&lt;</span><span class="n">DefId</span><span class="p">,</span><span class="w"> </span><span class="n">FunctionDependencies</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="c1">// let mut monomorphized_functions: HashSet&lt;(DefId, String)&gt; = default();</span>
<span class="w">    </span><span class="n">tcx</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">body_owners</span><span class="p">()</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">filter_map</span><span class="p">(</span><span class="o">|</span><span class="n">caller</span><span class="o">|</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">            </span><span class="kd">let</span><span class="w"> </span><span class="n">mir</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">tcx</span><span class="p">.</span><span class="n">mir_built</span><span class="p">(</span><span class="n">ty</span>::<span class="n">WithOptConstParam</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="n">did</span>: <span class="nc">caller</span><span class="p">,</span><span class="w"></span>
<span class="w">                </span><span class="n">const_param_did</span>: <span class="nc">tcx</span><span class="p">.</span><span class="n">opt_const_param_of</span><span class="p">(</span><span class="n">caller</span><span class="p">)</span><span class="w"></span>
<span class="w">            </span><span class="p">});</span><span class="w"></span>
<span class="w">            </span><span class="nb">None</span><span class="w"> </span><span class="c1">// mir real code does stuff with mir ;)</span>
<span class="w">        </span><span class="p">})</span><span class="w"></span>
<span class="w">        </span><span class="p">.</span><span class="n">collect</span><span class="p">()</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>When I run my rustdoc fork on a single file it works perfectly:</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>cargo run -- some_file.rs
</code></pre></div>
<p>~~However if I try to run it on a whole project, I get a panic:</p>
<div class="codehilite"><pre><span></span><code>$ RUSTDOC=target/release/my_binary cargo doc
thread &#39;rustc&#39; panicked at &#39;attempted to read from stolen value&#39;, /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_data_structures/src/steal.rs:35:21
</code></pre></div>
<p>I think I don't understand how I'm supposed to use MIR. I thought, that I long as I only called <code>mir.borrow()</code> to be able to use <code>mir::Body</code> I was fine (and not <code>mir.steal()</code>). What am I missing?</p>



<a name="218168029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168029">(Nov 28 2020 at 15:08)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> somone else is calling <code>steal()</code> before you call <code>borrow()</code></p>



<a name="218168030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168030">(Nov 28 2020 at 15:08)</a>:</h4>
<p>you need to find out who and why</p>



<a name="218168043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168043">(Nov 28 2020 at 15:08)</a>:</h4>
<p><code>rg steal -w</code> returns no results</p>



<a name="218168116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168116">(Nov 28 2020 at 15:10)</a>:</h4>
<p>I'd be suspicious of <a href="https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs#L465">https://github.com/rust-lang/rust/blob/master/src/librustdoc/core.rs#L465</a>, maybe</p>



<a name="218168118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168118">(Nov 28 2020 at 15:10)</a>:</h4>
<p>getting the backtrace would help too</p>



<a name="218168134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168134">(Nov 28 2020 at 15:11)</a>:</h4>
<div class="spoiler-block"><div class="spoiler-header">
<p>wall of text</p>
</div><div class="spoiler-content" aria-hidden="true">
<div class="codehilite"><pre><span></span><code> Running `/home/robin/dev/cargo-callgraph/target/debug/cargo-callgraph --crate-type lib --crate-name rustc_rayon_core /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-rayon-core-0.3.0/src/lib.rs --cap-lints allow -o /home/robin/dev/cargo-callgraph/target/doc --error-format=json --json=diagnostic-rendered-ansi -L dependency=/home/robin/dev/cargo-callgraph/target/debug/deps --extern crossbeam_deque=/home/robin/dev/cargo-callgraph/target/debug/deps/libcrossbeam_deque-d946aa781c891c9b.rmeta --extern crossbeam_queue=/home/robin/dev/cargo-callgraph/target/debug/deps/libcrossbeam_queue-e97d5e9eabb9deae.rmeta --extern crossbeam_utils=/home/robin/dev/cargo-callgraph/target/debug/deps/libcrossbeam_utils-dc839f467baf84df.rmeta --extern lazy_static=/home/robin/dev/cargo-callgraph/target/debug/deps/liblazy_static-88e83b46113e8454.rmeta --extern num_cpus=/home/robin/dev/cargo-callgraph/target/debug/deps/libnum_cpus-8691f1093f8a1d16.rmeta --crate-version 0.3.0`
</code></pre></div>

<p>thread 'rustc' panicked at 'attempted to read from stolen value', /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_data_structures/src/steal.rs:35:21<br>
stack backtrace:<br>
   0: std::panicking::begin_panic<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:519:12<br>
   1: rustc_data_structures::steal::Steal&lt;T&gt;::borrow::{{closure}}<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_data_structures/src/steal.rs:35:21<br>
   2: core::cell::Ref&lt;T&gt;::map<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cell.rs:1262:22<br>
   3: rustc_data_structures::steal::Steal&lt;T&gt;::borrow<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_data_structures/src/steal.rs:34:9<br>
   4: cargo_callgraph::extract_dependencies::extract_dependencies::{{closure}}<br>
             at /home/robin/dev/cargo-callgraph/extract_dependencies.rs:422:23<br>
   5: core::iter::adapters::map_fold::{{closure}}<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/mod.rs:905:28<br>
   6: core::iter::adapters::map_fold::{{closure}}<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/mod.rs:905:21<br>
   7: core::iter::traits::iterator::Iterator::fold<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:2023:21<br>
   8: &lt;core::iter::adapters::Map&lt;I,F&gt; as core::iter::traits::iterator::Iterator&gt;::fold<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/mod.rs:945:9<br>
   9: &lt;core::iter::adapters::Map&lt;I,F&gt; as core::iter::traits::iterator::Iterator&gt;::fold<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/mod.rs:945:9<br>
  10: core::iter::traits::iterator::Iterator::for_each<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:678:9<br>
  11: &lt;hashbrown:<span aria-label="map" class="emoji emoji-1f5fa" role="img" title="map">:map:</span>:HashMap&lt;K,V,S&gt; as core::iter::traits::collect::Extend&lt;(K,V)&gt;&gt;::extend<br>
             at /cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.9.0/src/map.rs:3041:9<br>
  12: &lt;std::collections:<span aria-label="hash" class="emoji emoji-0023-20e3" role="img" title="hash">:hash:</span><span aria-label="map" class="emoji emoji-1f5fa" role="img" title="map">:map:</span>:HashMap&lt;K,V,S&gt; as core::iter::traits::collect::Extend&lt;(K,V)&gt;&gt;::extend<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:2692:9<br>
  13: &lt;std::collections:<span aria-label="hash" class="emoji emoji-0023-20e3" role="img" title="hash">:hash:</span><span aria-label="map" class="emoji emoji-1f5fa" role="img" title="map">:map:</span>:HashMap&lt;K,V,S&gt; as core::iter::traits::collect::FromIterator&lt;(K,V)&gt;&gt;::from_iter<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:2677:9<br>
  14: core::iter::traits::iterator::Iterator::collect<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:1670:9<br>
  15: cargo_callgraph::extract_dependencies::extract_dependencies<br>
             at /home/robin/dev/cargo-callgraph/extract_dependencies.rs:415:5<br>
  16: cargo_callgraph::core::run_global_ctxt::{{closure}}<br>
             at /home/robin/dev/cargo-callgraph/core.rs:498:28<br>
  17: rustc_data_structures::profiling::VerboseTimingGuard::run<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_data_structures/src/profiling.rs:570:9<br>
  18: rustc_session::utils::&lt;impl rustc_session::session::Session&gt;::time<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_session/src/utils.rs:9:9<br>
  19: cargo_callgraph::core::run_global_ctxt<br>
             at /home/robin/dev/cargo-callgraph/core.rs:497:5<br>
  20: cargo_callgraph::core::run_core::{{closure}}::{{closure}}::{{closure}}::{{closure}}<br>
             at /home/robin/dev/cargo-callgraph/core.rs:474:21<br>
  21: rustc_interface::passes::QueryContext::enter::{{closure}}<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_interface/src/passes.rs:725:42<br>
  22: rustc_middle::ty::context::tls::enter_context::{{closure}}<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_middle/src/ty/context.rs:1735:50<br>
  23: rustc_middle::ty::context::tls::set_tlv<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_middle/src/ty/context.rs:1719:9<br>
  24: rustc_middle::ty::context::tls::enter_context<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_middle/src/ty/context.rs:1735:9<br>
  25: rustc_interface::passes::QueryContext::enter<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_interface/src/passes.rs:725:9<br>
  26: cargo_callgraph::core::run_core::{{closure}}::{{closure}}::{{closure}}<br>
             at /home/robin/dev/cargo-callgraph/core.rs:473:17<br>
  27: rustc_data_structures::profiling::VerboseTimingGuard::run<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_data_structures/src/profiling.rs:570:9<br>
  28: rustc_session::utils::&lt;impl rustc_session::session::Session&gt;::time<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_session/src/utils.rs:9:9<br>
  29: cargo_callgraph::core::run_core::{{closure}}::{{closure}}<br>
             at /home/robin/dev/cargo-callgraph/core.rs:472:46<br>
  30: rustc_interface::queries::&lt;impl rustc_interface::interface::Compiler&gt;::enter<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_interface/src/queries.rs:415:19<br>
  31: cargo_callgraph::core::run_core::{{closure}}<br>
             at /home/robin/dev/cargo-callgraph/core.rs:431:9<br>
  32: rustc_interface::interface::create_compiler_and_run::{{closure}}<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_interface/src/interface.rs:196:13<br>
  33: rustc_span::with_source_map<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_span/src/lib.rs:764:5<br>
  34: rustc_interface::interface::create_compiler_and_run<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_interface/src/interface.rs:190:5<br>
  35: cargo_callgraph::core::run_core<br>
             at /home/robin/dev/cargo-callgraph/core.rs:430:5<br>
  36: cargo_callgraph::main_options<br>
             at /home/robin/dev/cargo-callgraph/lib.rs:583:53<br>
  37: cargo_callgraph::main_args::{{closure}}<br>
             at /home/robin/dev/cargo-callgraph/lib.rs:516:17<br>
  38: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_interface/src/util.rs:152:13<br>
  39: scoped_tls::ScopedKey&lt;T&gt;::set<br>
             at /cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9<br>
  40: rustc_span::with_session_globals<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_span/src/lib.rs:93:5<br>
  41: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_interface/src/util.rs:150:9<br>
  42: rustc_interface::util::scoped_thread::{{closure}}<br>
             at /home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_interface/src/util.rs:125:24<br>
note: Some details are omitted, run with <code>RUST_BACKTRACE=full</code> for a verbose backtrace.</p>
</div></div>



<a name="218168174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168174">(Nov 28 2020 at 15:12)</a>:</h4>
<p>sorry - I meant the backtrace of steal, I'd just throw a <code>panic!</code> into <code>fn steal</code></p>



<a name="218168177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168177">(Nov 28 2020 at 15:12)</a>:</h4>
<p>I love the inline emojis in the middle of the codeblock!</p>



<a name="218168187"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168187" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168187">(Nov 28 2020 at 15:13)</a>:</h4>
<p>Btw I think it may be worth it to have a <code>debug!</code> in <code>steal()</code></p>



<a name="218168192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168192">(Nov 28 2020 at 15:13)</a>:</h4>
<p>Not for this particular issue, but in general</p>



<a name="218168194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168194">(Nov 28 2020 at 15:13)</a>:</h4>
<p>it might already, I haven't checked</p>



<a name="218168199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168199">(Nov 28 2020 at 15:13)</a>:</h4>
<p>I have no idea on how to do it, since I've build my source out of tree</p>



<a name="218168204"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168204" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168204">(Nov 28 2020 at 15:13)</a>:</h4>
<p>AFAICT it doesn't, actually</p>



<a name="218168252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168252">(Nov 28 2020 at 15:14)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">steal</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">T</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">value_ref</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="k">mut</span><span class="w"> </span><span class="o">*</span><span class="bp">self</span><span class="p">.</span><span class="n">value</span><span class="p">.</span><span class="n">try_write</span><span class="p">().</span><span class="n">expect</span><span class="p">(</span><span class="s">"stealing value which is locked"</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">value_ref</span><span class="p">.</span><span class="n">take</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="n">value</span><span class="p">.</span><span class="n">expect</span><span class="p">(</span><span class="s">"attempt to read from stolen value"</span><span class="p">)</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="218168286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168286">(Nov 28 2020 at 15:16)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> your backtrace shows<code>borrow</code>, but it doesn't appear in your code</p>



<a name="218168404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168404">(Nov 28 2020 at 15:18)</a>:</h4>
<p>It's not. (hence the absence of results with <code>rg</code>)</p>



<a name="218168423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168423">(Nov 28 2020 at 15:19)</a>:</h4>
<p>this is going to be tricky then, because you're missing debug symbols to show the actual function that caused this</p>



<a name="218168426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168426">(Nov 28 2020 at 15:19)</a>:</h4>
<p>I totally forgot, what is the word you use to say that the rustc crate is imported not from <code>Cargo.toml</code> but as an extern crate?</p>



<a name="218168430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168430">(Nov 28 2020 at 15:19)</a>:</h4>
<p><a href="#narrow/stream/131828-t-compiler/topic/Debug.20symbols.20in.20separate.20files.3F">https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Debug.20symbols.20in.20separate.20files.3F</a></p>



<a name="218168431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168431">(Nov 28 2020 at 15:19)</a>:</h4>
<p>loaded from sysroot</p>



<a name="218168435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168435">(Nov 28 2020 at 15:19)</a>:</h4>
<p>(deleted)</p>



<a name="218168579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168579">(Nov 28 2020 at 15:22)</a>:</h4>
<p>In the backtrace, the 4th element is</p>
<div class="codehilite"><pre><span></span><code>/home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_data_structures/src/steal.rs
</code></pre></div>
<p>But the folder</p>
<div class="codehilite"><pre><span></span><code>/home/robin/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler
</code></pre></div>
<p>doesn't exists</p>



<a name="218168588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168588">(Nov 28 2020 at 15:23)</a>:</h4>
<p>so I can't even modify it inline :(</p>



<a name="218168727"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168727" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168727">(Nov 28 2020 at 15:27)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> I would recommend building with x.py rather than trying to modify rustc out of tree</p>



<a name="218168840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168840">(Nov 28 2020 at 15:30)</a>:</h4>
<p>So  I copy all of my code in-place of librustdoc, re-name it back to rustdoc. Then what should I run to only build "rustdoc" <code>./x.py build rustdoc</code>?</p>



<a name="218168916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168916">(Nov 28 2020 at 15:32)</a>:</h4>
<p>x.py build src/tools/rustdoc library/std</p>



<a name="218168921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168921">(Nov 28 2020 at 15:32)</a>:</h4>
<p>Or actually I think just x.py build will work</p>



<a name="218168924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218168924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218168924">(Nov 28 2020 at 15:33)</a>:</h4>
<p>Since the tools change never landed</p>



<a name="218169272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169272">(Nov 28 2020 at 15:43)</a>:</h4>
<p>I thought it was possible to not build llvm, but to download a pre-build binary. I forgot how to do it</p>



<a name="218169330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169330">(Nov 28 2020 at 15:45)</a>:</h4>
<p>Run x.py setup, it will make things nice</p>



<a name="218169334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169334">(Nov 28 2020 at 15:45)</a>:</h4>
<p>(I guess people aren't reading the help text?)</p>



<a name="218169367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169367">(Nov 28 2020 at 15:46)</a>:</h4>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[llvm]</span>
<span class="n">download-ci-llvm</span> <span class="o">=</span> <span class="kc">true</span>
</code></pre></div>
<p>This is probably what you mean <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="218169381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169381">(Nov 28 2020 at 15:46)</a>:</h4>
<p>(From <a href="https://rustc-dev-guide.rust-lang.org/building/suggested.html#skipping-llvm-build">https://rustc-dev-guide.rust-lang.org/building/suggested.html#skipping-llvm-build</a>)</p>



<a name="218169390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169390">(Nov 28 2020 at 15:47)</a>:</h4>
<p>Right, that will break on Mac or windows though</p>



<a name="218169401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169401">(Nov 28 2020 at 15:47)</a>:</h4>
<p>The default is if-available if you use x.py setup</p>



<a name="218169454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169454">(Nov 28 2020 at 15:48)</a>:</h4>
<p><em>I didn't even know <code>x.py setup</code> existed</em> <span aria-label="big smile" class="emoji emoji-1f604" role="img" title="big smile">:big_smile:</span></p>



<a name="218169463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169463">(Nov 28 2020 at 15:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60/near/218169334">said</a>:</p>
<blockquote>
<p>(I guess people aren't reading the help text?)</p>
</blockquote>
<p>What help text? <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="218169464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169464">(Nov 28 2020 at 15:49)</a>:</h4>
<p>it's not proposed in <code>x.py setup</code> if you choose option b ("compiler: Contribute to the compiler or rustdoc")</p>



<a name="218169476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169476">(Nov 28 2020 at 15:49)</a>:</h4>
<p>and it's not in <code>x.py --help</code> either</p>



<a name="218169478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169478">(Nov 28 2020 at 15:49)</a>:</h4>
<p>nor <code>x.py build --help</code></p>



<a name="218169595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169595">(Nov 28 2020 at 15:52)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> it should have generated <code>profile = "compiler"</code></p>



<a name="218169598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169598">(Nov 28 2020 at 15:52)</a>:</h4>
<p>and since that didn't work I'm guessing you're on mac</p>



<a name="218169600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169600">(Nov 28 2020 at 15:52)</a>:</h4>
<p>so you're out of luck, sorry</p>



<a name="218169612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169612">(Nov 28 2020 at 15:52)</a>:</h4>
<p>nope, on archlinux, intel 64 bits</p>



<a name="218169625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169625">(Nov 28 2020 at 15:53)</a>:</h4>
<p>can you paste config.toml here?</p>



<a name="218169740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169740">(Nov 28 2020 at 15:56)</a>:</h4>
<div class="codehilite"><pre><span></span><code># Includes one of the default files in src/bootstrap/defaults
profile = &quot;compiler&quot;
changelog-seen = 2
</code></pre></div>



<a name="218169747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169747">(Nov 28 2020 at 15:57)</a>:</h4>
<p>but I re-run <code>x.py setup</code> since I did the first compilation 15 minutes ago</p>



<a name="218169751"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169751" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169751">(Nov 28 2020 at 15:57)</a>:</h4>
<p>that should be working, then, weird</p>



<a name="218169754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169754">(Nov 28 2020 at 15:57)</a>:</h4>
<p>when you run<code>x.py build</code> it builds llvm?</p>



<a name="218169800"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169800" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169800">(Nov 28 2020 at 15:58)</a>:</h4>
<p>I also added the llvm section as Léo proposed. I'm waiting to see if at one point llvm is built (I interrupted the first build)</p>



<a name="218169810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169810">(Nov 28 2020 at 15:58)</a>:</h4>
<p>So far it's building rust crates</p>



<a name="218169813"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169813" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169813">(Nov 28 2020 at 15:58)</a>:</h4>
<p>oh if it's not being built now it won't be built</p>



<a name="218169815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218169815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218169815">(Nov 28 2020 at 15:58)</a>:</h4>
<p>it's built before rustc</p>



<a name="218170319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218170319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218170319">(Nov 28 2020 at 16:12)</a>:</h4>
<blockquote>
<p>Build completed successfully in 0:23:25</p>
</blockquote>
<p>Yeah, so much speed!</p>



<a name="218170324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218170324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218170324">(Nov 28 2020 at 16:12)</a>:</h4>
<p>I'm blaming my CPU, not the build system btw</p>



<a name="218170403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218170403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218170403">(Nov 28 2020 at 16:15)</a>:</h4>
<p>nah, it takes my laptop 45 minutes to compile rustc</p>



<a name="218170405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218170405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218170405">(Nov 28 2020 at 16:15)</a>:</h4>
<p>absolutely awful <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="218171351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218171351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218171351">(Nov 28 2020 at 16:43)</a>:</h4>
<p>yeah, 45 mn is really high</p>



<a name="218223516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218223516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218223516">(Nov 29 2020 at 18:25)</a>:</h4>
<p>So I was able to copy back all of my modification into my local copy of the <code>rust</code> repo, and build my custom "<code>rustdoc</code>". How do I use it with cargo?</p>



<a name="218223528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218223528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218223528">(Nov 29 2020 at 18:26)</a>:</h4>
<p><a href="https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html?highlight=rustup,link#creating-a-rustup-toolchain">https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html?highlight=rustup,link#creating-a-rustup-toolchain</a></p>



<a name="218223543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218223543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218223543">(Nov 29 2020 at 18:26)</a>:</h4>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>$ <span class="nv">RUST_BACKTRACE</span><span class="o">=</span><span class="m">1</span> <span class="nv">RUSTDOC</span><span class="o">=</span>/home/robin/dev/rust/target/debug/rustdoc_tool_binary cargo doc
warning: output filename collision.
The lib target <span class="sb">`</span>crossbeam-utils<span class="sb">`</span> in package <span class="sb">`</span>crossbeam-utils v0.7.2<span class="sb">`</span> has the same output filename as the lib target <span class="sb">`</span>crossbeam-utils<span class="sb">`</span> in package <span class="sb">`</span>crossbeam-utils v0.6.6<span class="sb">`</span>.
Colliding filename is: /home/robin/dev/cargo-callgraph/target/doc/crossbeam_utils/index.html
The targets should have unique names.
This is a known bug where multiple crates with the same name use
the same path<span class="p">;</span> see &lt;https://github.com/rust-lang/cargo/issues/6313&gt;.
 Documenting itoa v0.4.6
 Documenting regex-syntax v0.6.21
 Documenting dot v0.1.4
 Documenting crossbeam-utils v0.6.6
/home/robin/dev/rust/target/debug/rustdoc_tool_binary: error <span class="k">while</span> loading shared libraries: libtest-5016d499037f0dbe.so: cannot open shared object file: No such file or directory
/home/robin/dev/rust/target/debug/rustdoc_tool_binary: error <span class="k">while</span> loading shared libraries: libtest-5016d499037f0dbe.so: cannot open shared object file: No such file or directory
/home/robin/dev/rust/target/debug/rustdoc_tool_binary: error <span class="k">while</span> loading shared libraries: libtest-5016d499037f0dbe.so: cannot open shared object file: No such file or directory
error: could not document <span class="sb">`</span>itoa<span class="sb">`</span>

Caused by:
  process didn<span class="err">'</span>t <span class="nb">exit</span> successfully: <span class="sb">`</span>/home/robin/dev/rust/target/debug/rustdoc_tool_binary --crate-type lib --crate-name itoa /home/robin/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.4.6/src/lib.rs --cap-lints allow -o /home/robin/dev/cargo-callgraph/target/doc --error-format<span class="o">=</span>json --json<span class="o">=</span>diagnostic-rendered-ansi -L <span class="nv">dependency</span><span class="o">=</span>/home/robin/dev/cargo-callgraph/target/debug/deps --crate-version <span class="m">0</span>.4.6<span class="sb">`</span> <span class="o">(</span><span class="nb">exit</span> code: <span class="m">127</span><span class="o">)</span>
warning: build failed, waiting <span class="k">for</span> other <span class="nb">jobs</span> to finish...
/home/robin/dev/rust/target/debug/rustdoc_tool_binary: error <span class="k">while</span> loading shared libraries: libtest-5016d499037f0dbe.so: cannot open shared object file: No such file or directory
error: build failed
</code></pre></div>



<a name="218223659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218223659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218223659">(Nov 29 2020 at 18:28)</a>:</h4>
<p>right, because you're not using a rustup toolchain</p>



<a name="218223662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218223662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218223662">(Nov 29 2020 at 18:28)</a>:</h4>
<p>the instructions I linked should work</p>



<a name="218223954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218223954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218223954">(Nov 29 2020 at 18:34)</a>:</h4>
<p>I admit, I'm lost. I build rustdoc with <code>./x.py build src/tools/rustdoc</code>. I think I need to put my new rustdoc into a new distribution. According to <a href="https://rustc-dev-guide.rust-lang.org/building/build-install-distribution-artifacts.html">that page</a> it seems to just be <code>x.py dist</code>, but I would have assume that this would put more than just rustdoc in it?</p>



<a name="218223975"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218223975" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218223975">(Nov 29 2020 at 18:34)</a>:</h4>
<p>what? where are you seeing x.py dist?</p>



<a name="218223981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218223981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218223981">(Nov 29 2020 at 18:35)</a>:</h4>
<p><code>rustup toolchain link stage1 build/&lt;host-triple&gt;/stage1</code></p>



<a name="218224001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224001">(Nov 29 2020 at 18:35)</a>:</h4>
<p>distribution artifacts are a separate thing, that's not what you want</p>



<a name="218224050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224050">(Nov 29 2020 at 18:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60/near/218223975">said</a>:</p>
<blockquote>
<p>what? where are you seeing x.py dist?</p>
</blockquote>
<p>On the "build distribution artifact" page</p>



<a name="218224057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224057">(Nov 29 2020 at 18:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60/near/218224001">said</a>:</p>
<blockquote>
<p>distribution artifacts are a separate thing, that's not what you want</p>
</blockquote>
<p>ah!</p>



<a name="218224142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224142">(Nov 29 2020 at 18:38)</a>:</h4>
<p>also you'll want <code>x.py build</code> or it won't have the standard library</p>



<a name="218224273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224273">(Nov 29 2020 at 18:40)</a>:</h4>
<p>in the rustc repo</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>$ rustup toolchain link stage1 build/x86_64-unknown-linux-gnu/stage1
$ ./x.py build +stage1 src/tools/rustdoc
Updating only changed submodules
Submodules updated in <span class="m">0</span>.04 seconds
    Finished dev <span class="o">[</span>unoptimized + debuginfo<span class="o">]</span> target<span class="o">(</span>s<span class="o">)</span> in <span class="m">0</span>.43s
thread <span class="s1">'main'</span> panicked at <span class="s1">'error: no rules matched +stage1'</span>, src/bootstrap/builder.rs:225:17
note: run with <span class="sb">`</span><span class="nv">RUST_BACKTRACE</span><span class="o">=</span><span class="m">1</span><span class="sb">`</span> environment variable to display a backtrace
failed to run: /home/robin/dev/rust/build/bootstrap/debug/bootstrap build +stage1 src/tools/rustdoc
Build completed unsuccessfully in <span class="m">0</span>:00:01
$ ./x.py build +stage1
Updating only changed submodules
Submodules updated in <span class="m">0</span>.02 seconds
    Finished dev <span class="o">[</span>unoptimized + debuginfo<span class="o">]</span> target<span class="o">(</span>s<span class="o">)</span> in <span class="m">0</span>.17s
thread <span class="s1">'main'</span> panicked at <span class="s1">'error: no rules matched +stage1'</span>, src/bootstrap/builder.rs:225:17
note: run with <span class="sb">`</span><span class="nv">RUST_BACKTRACE</span><span class="o">=</span><span class="m">1</span><span class="sb">`</span> environment variable to display a backtrace
failed to run: /home/robin/dev/rust/build/bootstrap/debug/bootstrap build +stage1
Build completed unsuccessfully in <span class="m">0</span>:00:00
</code></pre></div>
<p>Then on the crate I want to analyze:</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code><span class="nv">RUST_BACKTRACE</span><span class="o">=</span><span class="m">1</span> cargo +stage1 doc
warning: output filename collision.
The lib target <span class="sb">`</span>crossbeam-utils<span class="sb">`</span> in package <span class="sb">`</span>crossbeam-utils v0.7.2<span class="sb">`</span> has the same output filename as the lib target <span class="sb">`</span>crossbeam-utils<span class="sb">`</span> in package <span class="sb">`</span>crossbeam-utils v0.6.6<span class="sb">`</span>.
Colliding filename is: /home/robin/dev/cargo-callgraph/target/doc/crossbeam_utils/index.html
The targets should have unique names.
This is a known bug where multiple crates with the same name use
the same path<span class="p">;</span> see &lt;https://github.com/rust-lang/cargo/issues/6313&gt;.
    Checking cfg-if v0.1.10
   Compiling libc v0.2.80
   Compiling autocfg v1.0.1
    Checking lazy_static v1.4.0
error<span class="o">[</span>E0463<span class="o">]</span>: can<span class="s1">'t find crate for `std`</span>

<span class="s1">error[E0463]: can'</span>t find crate <span class="k">for</span> <span class="sb">`</span>std<span class="sb">`</span>

error<span class="o">[</span>E0463<span class="o">]</span>: can<span class="s1">'t find crate for `core`</span>

<span class="s1">error[E0463]: can'</span>t find crate <span class="k">for</span> <span class="sb">`</span>core<span class="sb">`</span>

error: aborting due to previous error

For more information about this error, try <span class="sb">`</span>rustc --explain E0463<span class="sb">`</span>.
error: aborting due to previous error

error: aborting due to previous error

error: aborting due to previous error

For more information about this error, try <span class="sb">`</span>rustc --explain E0463<span class="sb">`</span>.
For more information about this error, try <span class="sb">`</span>rustc --explain E0463<span class="sb">`</span>.
For more information about this error, try <span class="sb">`</span>rustc --explain E0463<span class="sb">`</span>.
error: could not compile <span class="sb">`</span>lazy_static<span class="sb">`</span>

To learn more, run the <span class="nb">command</span> again with --verbose.
warning: build failed, waiting <span class="k">for</span> other <span class="nb">jobs</span> to finish...
error: build failed
</code></pre></div>



<a name="218224297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224297">(Nov 29 2020 at 18:41)</a>:</h4>
<p>right, you built rustdoc but not the standard library</p>



<a name="218224306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224306">(Nov 29 2020 at 18:41)</a>:</h4>
<p><code>+stage1</code> is rustup syntax, not x.py syntax</p>



<a name="218224354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224354">(Nov 29 2020 at 18:42)</a>:</h4>
<p><code>x.py build --stage 1 library/std src/tools/rustdoc</code> is what you want, but that happens to be the default so you can just use <code>x.py build</code></p>



<a name="218224374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224374">(Nov 29 2020 at 18:42)</a>:</h4>
<p>ok, perfect</p>



<a name="218224397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224397">(Nov 29 2020 at 18:43)</a>:</h4>
<p>I recommend reading through <a href="https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html">https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html</a> at some point</p>



<a name="218224920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218224920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218224920">(Nov 29 2020 at 18:54)</a>:</h4>
<p><em>Note: this is not an attack against any one, or even the Rust project, I just wanted to explain my current thought process</em></p>
<p>I think I read it a few month ago (I need to re-read it), but what is <em>really</em> confusing for my specific use-case is that I don't <em>feel</em> that I need to do all of that because I'm not trying to build rustc. All of the bootstrapping consideration <em>feels</em> that they should not exist (for my use-case), because I'm just building a regular rust application. I have the <em>feeling</em> that I just need a rust parser, and it happens that this parser is the internal parts of rustc. I know that those internal parts requires a <strong>very</strong> blinding edge compiler, but given that I didn't modified it at all, at least the latest nightly should be recent enough to be able to build it. Apart from having a very recent nightly, I am <em>not</em> expecting to have anything else to change to my workflow, especially <strong>not</strong> being able to use cargo. I would <strong>absolutely</strong> not have the same position if I was currently modifying the internals of rustc/stdlib, especially if I was directly using the things I was currently implementing (bootstrapping consideration would be very relevant).</p>
<p>I put some emphasis, because it's what I <em>feel</em>, but may not what it <em>can</em> be, nor what it <em>is</em> currently. I am aware of the current libraryfication of rustc, but I don't know what is the current status.</p>



<a name="218225040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225040">(Nov 29 2020 at 18:57)</a>:</h4>
<p>And don't get me wrong, I absolutely understand what, and why bootstrapping is needed (and why it's extremely hard to do) when building a compiler.</p>



<a name="218225099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225099">(Nov 29 2020 at 18:58)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> if you <em>really</em> <em>really</em> want to use cargo, you can use <code>cd compiler/rustc &amp;&amp; cargo +nightly build</code></p>



<a name="218225106"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225106" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225106">(Nov 29 2020 at 18:58)</a>:</h4>
<p><em>however</em>, that does not set up a sysroot, that does not build llvm, that does not provide you a way to use the compiler you just built from rustdoc</p>



<a name="218225116"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225116" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225116">(Nov 29 2020 at 18:59)</a>:</h4>
<p>It's not that I want, it's that I don't understand why I can't.</p>



<a name="218225124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225124">(Nov 29 2020 at 18:59)</a>:</h4>
<p>if you're interested in making <code>cargo build</code> work for rustdoc, I would <em>love</em> to have that, it just doesn't work right now</p>



<a name="218225129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225129">(Nov 29 2020 at 18:59)</a>:</h4>
<p><a href="#narrow/stream/266220-rustdoc/topic/Building.20rustdoc.20out.20of.20tree">https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Building.20rustdoc.20out.20of.20tree</a></p>



<a name="218225133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225133">(Nov 29 2020 at 18:59)</a>:</h4>
<p>I also understand that the guides are targeted against someone who want to build the compiler (it's the rustc crate after all <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span> )</p>



<a name="218225140"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225140" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225140">(Nov 29 2020 at 18:59)</a>:</h4>
<p><span class="user-mention silent" data-user-id="281841">Robin Moussu</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60/near/218225116">said</a>:</p>
<blockquote>
<p>It's not that I want, it's that I don't understand why I can't.</p>
</blockquote>
<p>ok, please read the bootstrapping chapter then</p>



<a name="218225143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225143">(Nov 29 2020 at 18:59)</a>:</h4>
<p>if you still have questions after that I'm happy to answer them</p>



<a name="218225374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225374">(Nov 29 2020 at 19:04)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60/near/218225124">said</a>:</p>
<blockquote>
<p>if you're interested in making <code>cargo build</code> work for rustdoc, I would <em>love</em> to have that, it just doesn't work right now</p>
</blockquote>
<p>I would <em>love</em> to help with that, but currently I know that I don't have the expertise to do it. That's a chicken and egg problem! It's unfortunately often the case on big project. The people who will understand the best what doesn't work the way it should are newcomers (because it's much more painful than needed), but they don't have the knowledge to fix it (especially documentation), while more experience people notices those issue much less (because they know how to ignore them), and don't really have the time to do it anyway because their expertise make them required in even more important issue.</p>



<a name="218225401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225401">(Nov 29 2020 at 19:05)</a>:</h4>
<p>I will try to dedicate some time to building rustdoc in-trre with RTIM this week.</p>



<a name="218225413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225413">(Nov 29 2020 at 19:05)</a>:</h4>
<p>I think if we solve the sysroot issue it won't actually be that hard</p>



<a name="218225442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218225442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218225442">(Nov 29 2020 at 19:06)</a>:</h4>
<p>The tricky bit is how to document it without it being even more confusing than it is currently</p>



<a name="218226008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218226008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218226008">(Nov 29 2020 at 19:18)</a>:</h4>
<p>The other thing is there needs to be a way to run the tests without going through x.py</p>



<a name="218226014"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218226014" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218226014">(Nov 29 2020 at 19:18)</a>:</h4>
<p>Maybe we could set compiletest as a dev-dependency and forward all the arguments through?</p>



<a name="218226276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218226276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218226276">(Nov 29 2020 at 19:26)</a>:</h4>
<p>I want to understand why is my MIR stolen ;) I think the easiest way to find it is to show the backtrace every time the <code>steal()</code> function is called. I see three possibilities</p>
<ol>
<li>unconditionally panic (instead of just panicking when stealing already stolen MIR)</li>
<li>run <code>cargo +stage1 doc</code> within gdb</li>
<li>prints the backtrace each time I'm in the steal function</li>
</ol>
<p>I can't do 1) because x.py seems to build the compiler with the modifying steal, then use the faulty compiler to build rustdoc. For 2,  it's much harder than I thought initially, mostly because <code>cargo</code> forks, and I need to know on which child I need to attach gdb. I guess 3 would be the easiest, but I'm not sure on how to do it.</p>



<a name="218226326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218226326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218226326">(Nov 29 2020 at 19:26)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> FYI building without x.py will never have debuginfo</p>



<a name="218226335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218226335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218226335">(Nov 29 2020 at 19:26)</a>:</h4>
<p>since it isn't published in nightlies or in the <code>@bors try</code> runs</p>



<a name="218226348"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218226348" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218226348">(Nov 29 2020 at 19:27)</a>:</h4>
<p><span class="user-mention" data-user-id="281841">@Robin Moussu</span> I recommend 2, you can find what cargo is doing with <code>-v</code></p>



<a name="218226412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218226412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218226412">(Nov 29 2020 at 19:28)</a>:</h4>
<p>1) isn't building rustdoc with the new compiler, btw, it's building the standard library</p>



<a name="218226419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218226419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218226419">(Nov 29 2020 at 19:28)</a>:</h4>
<p>theoretically you could <em>only</em> build rustdoc and not the standard library, then try to run your program on a <code>no_core</code> file</p>



<a name="218226525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Issue%20with%20%60rustc_middle%3A%3Amir_built%28%29%60/near/218226525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Robin Moussu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60.html#218226525">(Nov 29 2020 at 19:31)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Issue.20with.20.60rustc_middle.3A.3Amir_built().60/near/218226412">said</a>:</p>
<blockquote>
<p>1) isn't building rustdoc with the new compiler, btw, it's building the standard library</p>
</blockquote>
<p>Right ;)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>